﻿@* Generator: Template TypeVisibility: Internal *@
@using System.Globalization
@using System.IO
@using System.Reflection
@using Elmah
@using Elmah.Analysis
@inherits WebTemplateBase
@{
    var basePageName = Request.ServerVariables["URL"];

    const string title = "ELMAH Configuration Analysis";
    Layout = new Elmah.MasterPage
    {
        Context  = Context, /* TODO Consider not requiring this */
        Title    = title,
        SpeedBarItems = new[]
        {
            SpeedBar.Home.Format(basePageName),
            SpeedBar.Help,
            SpeedBar.About.Format(basePageName),
        },
    };
}        
<h1 id="PageTitle">@title</h1>

@if(string.IsNullOrEmpty(ConfigurationAnalysisHelper.LastOutputFilename))
{
    <p>Configuration analysis has not run since this application started. 
        Please add the following to the Application_Start method in your global.asax file:
    </p>
    <pre>
        protected void Application_Start()
        {
            Elmah.Analysis.ConfigurationAnalysisHelper.RunConfigurationAnalysis();
        }    
    </pre>
}
else
{
    <p>Configuration analysis was successfully ran @ConfigurationAnalysisHelper.LastRunDate.ToString("F", CultureInfo.InvariantCulture).</p>
    <p>The results can be found here: @ConfigurationAnalysisHelper.LastOutputFilename.</p>
}
